#include<iostream>
using namespace std;
int main()
{
	for(int red=0;red<=3;red++)
	{
		for(int yellow=0;yellow<=3;yellow++)
		{
			int green=8-red-yellow;
			if(green>=0&&green<=6)
			cout<<red<<" "<<yellow<<" "<<green<<endl;
		}
	}
	return 0;
}
